Skip to content

refactor inlist reading#970

Open
VincentVanlaer wants to merge 1 commit intomainfrom
refactor-inlist-reading
Open

refactor inlist reading#970
VincentVanlaer wants to merge 1 commit intomainfrom
refactor-inlist-reading

Conversation

@VincentVanlaer
Copy link
Copy Markdown
Member

This commit introduces utils_namelist, which abstracts some of the common aspects of reading inlists in MESA (error message, nested inlists, ...). Previously, various different namelist reading routines were copied and modified around the code base. These have accrued various differences over time, which has been fixed now.

The following behaviour has been changed:

  • pgbinary and pgstar no longer make MESA error when they are missing from inlists
  • it no longer matters where in the chain of inlist a namelist section is missing. It used to be that for certain section, only the first inline in a chain was allowed to have a missing section.
  • checks and copying of options only happens once all inlists have been read
  • failures when reading inlists will no longer dump a stack trace on the user

This commit introduces utils_namelist, which abstracts some of the
common aspects of reading inlists in MESA (error message, nested
inlists, ...). Previously, various different namelist reading routines
were copied and modified around the code base. These have accrued
various differences over time, which has been fixed now.

The following behaviour has been changed:

- pgbinary and pgstar no longer make MESA error when they are missing
  from inlists
- it no longer matters where in the chain of inlist a namelist section
  is missing. It used to be that for certain section, only the first
  inline in a chain was allowed to have a missing section.
- checks and copying of options only happens once all inlists have been
  read
- failures when reading inlists will no longer dump a stack trace on the
  user
@VincentVanlaer
Copy link
Copy Markdown
Member Author

The way I have implemented this is different from the usual way MESA is structured. Rather than having the utils_namelist module be included with utils_lib, I have exposed it separately. The main reason for doing is that it allowed me to iterate quicker on the interface design, as changes to the utils_lib interface require most of MESA to be recompiled.

@VincentVanlaer VincentVanlaer linked an issue Apr 21, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harmonize missing inlist/section in inlist handling

1 participant